/**标签 */

import { JsonController, Authorized, Body, HeaderParam, Get, Post, UseBefore, QueryParam} from 'routing-controllers';
import { RequestLog } from '@/middleware/requestLog'
import { Inject, Service } from 'typedi';
import { JsonResult, msgList, res } from '@/utils/jsonResult';
import {CommentParams } from "@/model/request/Comment";
import config from '@/config'
import { Token } from '@/m_req/Token';
import { TaghdServiceImpl } from '@/service/impl/admin/TaghdServiceImpl';

@Service()
@JsonController(config.setPrefix("admin/taghd"))
export class TaghdController{

  @Inject()
  TaghdServiceImpl!: TaghdServiceImpl;

  @Inject()
  json!: JsonResult<any>;  // Promise<res<string>> 

    //标签添加
    @Post('/add')
    @UseBefore(RequestLog)
  
    async add(@Body() params:{tag_title:string}):Promise<any>{
       
      return await this.TaghdServiceImpl.Taghdadd(params);
    }

    //标签删除
    @Post('/delete')
    @UseBefore(RequestLog)
  
    async delete(@Body() params:{tag_id:number,tag_title:string}):Promise<any>{
       
      return await this.TaghdServiceImpl.Taghddelete(params);
    }

    //标签删除
    @Post('/updata')
    @UseBefore(RequestLog)
  
    async updata(@Body() params:{tag_id:number,tag_title:string}):Promise<any>{
       
      return await this.TaghdServiceImpl.Taghdupdata(params);
    }


       //标签查询
       @Post('/select')
       @UseBefore(RequestLog)
     
       async select(@Body() params:{page:number}):Promise<any>{
          
         return await this.TaghdServiceImpl.Taghdselect(params);
       }

       //标签查询
       @Post('/queries')
       @UseBefore(RequestLog)
     
       async queries(@Body() params:{text:string}):Promise<any>{
          
         return await this.TaghdServiceImpl.Taghdqueries(params);
       }

       
}